import request from '@/utils/request'
import { serverEncrypt } from '@/utils/jsencrypt'

//获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    method: 'get'
  })
}

/**
 * 登录 登录接口必须密文传输
 * @param {*} loginForm
 */
export function login(loginForm) {
  loginForm = JSON.stringify(loginForm)
  //服务端加密
  loginForm = serverEncrypt(loginForm)
  return request({
    url: '/login',
    method: 'post',
    data: loginForm
  })
}
